package com.whz.workmanageol.service.impl;

import com.whz.workmanageol.service.ExcelTempService;
import com.whz.workmanageol.types.ExcelType;
import com.whz.workmanageol.utils.ExcelTempCreate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import javax.servlet.http.HttpServletResponse;

@Service
@Transactional
public class ExcelTempServiceImpl implements ExcelTempService {

    @Autowired
    private ExcelTempCreate excelTempCreate;

    @Override
    public void studentInfo(HttpServletResponse response) {
        excelTempCreate.createInfo(response, ExcelType.STUDENT);
    }

    @Override
    public void teacherInfo(HttpServletResponse response) {
        excelTempCreate.createInfo(response, ExcelType.TEACHER);
    }

    @Override
    public void gradeInfo(HttpServletResponse response) {
        excelTempCreate.createInfo(response, ExcelType.GRADE);
    }

    @Override
    public void courseInfo(HttpServletResponse response) {
        excelTempCreate.createInfo(response, ExcelType.COURSE);
    }

    @Override
    public void gradeCourseInfo(HttpServletResponse response) {
        excelTempCreate.createInfo(response, ExcelType.GRADECOURSE);
    }

    @Override
    public void studentGradeInfo(HttpServletResponse response) {
        excelTempCreate.createInfo(response, ExcelType.STUGRADE);
    }

    @Override
    public void studentCourseInfo(HttpServletResponse response) {
        excelTempCreate.createInfo(response, ExcelType.STUCOURSE);
    }

    @Override
    public void teacherGradeInfo(HttpServletResponse response) {
        excelTempCreate.createInfo(response, ExcelType.TEAGRADE);
    }

    @Override
    public void teacherCourseInfo(HttpServletResponse response) {
        excelTempCreate.createInfo(response, ExcelType.TEACOURSE);
    }

}
